﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="DangSanPham.aspx.cs"
    Inherits="QuangMobile.Admin.DangSanPham" MasterPageFile="~/Admin/AdminSite.Master" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div class="NoiDungChinh">
        <img class="FormImage" src="images/computer.png" />
        <p class="FormTitle">
            Quản trị Tư liệu văn kiện</p>
    </div>
    <style>
        .FtiWidth
        {
            width: auto;
            margin: 5px;
        }
        .DanhSach
        {
            background-color: #F4F7FC;
            border-bottom: 1px solid #83D4FC;
        }
        .ThemMoi
        {
            background-color: #FAF0E6;
        }
    </style>
    <div class="NoiDung">
        <div class="MenuDoc TLVK">
            <br />
            <span style="">Danh mục tư liệu văn kiện</span>
            <asp:Menu ID="MenuTLVK" runat="server" OnMenuItemClick="MenuTLVK_MenuItemClick">
            </asp:Menu>
        </div>
        <div class="FormThaoTac DanhSach">
            <p class="TableTitle" runat="server" id="TableTitle">
            </p>
            <asp:GridView ID="grdDanhMuc" runat="server" AutoGenerateColumns="False" CssClass="ListTable FtiWidth"
                DataKeyNames="ID" OnRowCommand="grdDanhMuc_RowCommand" 
                onrowcancelingedit="grdDanhMuc_RowCancelingEdit" 
                onrowediting="grdDanhMuc_RowEditing">
                <Columns>
                    <asp:TemplateField HeaderText="STT">
                        <ItemTemplate>
                            <asp:Label ID="lblIDDM" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tiêu đề">
                        <ItemTemplate>
                            <asp:Label ID="lblTieuDe" runat="server" Text='<%# Eval("TieuDe") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày phê duyệt">
                        <ItemTemplate>
                            <asp:Label ID="lblNgayCapNhat" runat="server" Text='<%# Eval("PheDuyetDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Người đăng tin" DataField="HoTen" ReadOnly="true" />
                    <asp:TemplateField HeaderText="Phê duyệt">
                        <ItemStyle Wrap="False" Width="60px" HorizontalAlign="Center"></ItemStyle>
                        <ItemTemplate>
                            <asp:ImageButton ID="imgEdit" runat="server" ImageUrl="../images/061.png" ToolTip="Phe Duyệt"
                                CommandArgument='<%# Eval("ID")%>' CommandName="Edit"></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="70px"></ItemStyle>
                        <EditItemTemplate>
                            <asp:ImageButton ID="imgUpdate" runat="server" ImageUrl="../images/approval.png"
                                ToolTip="Cập nhật" CommandArgument='<%# Eval("ID")%>' CommandName="<%# QuangMobile.MyConst.Action.Approve %>">
                            </asp:ImageButton>
                            <asp:ImageButton ID="imgCancel" runat="server" CommandName="Cancel" ImageUrl="../images/cancel.png"
                                CommandArgument='<%# Eval("ID") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sửa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtEdit" runat="server" ImageUrl="../images/edit.gif" CommandName="<%# QuangMobile.MyConst.Action.Update %>"
                                CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtDelete" runat="server" ImageUrl="../images/delete.png" CommandName="<%# QuangMobile.MyConst.Action.Delete %>"
                                OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')"
                                CommandArgument='<%# Eval("ID") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Button ID="btnThem" runat="server" Text="Thêm mới" CssClass="cmdBtn" OnClick="btnThem_Click"
                CausesValidation="False" Visible="false" />
        </div>
        <div class="FormThaoTac ThemMoi" runat="server" id="formUpdate" visible="false">
            <h1 class="TableTitle" style="padding-top:20px">Cập nhật Tư liệu văn kiện</h1>
            <asp:HiddenField ID="MenuID" runat="server" />
            <table class="ListForm">
                <tr>
                    <td>
                        Tiêu đề
                    </td>
                    <td>
                        <asp:TextBox ID="txtTieuDe" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        File đính kèm
                    </td>
                    <td>
                        <asp:FileUpload ID="ImgUploadFile" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td valign="top" colspan="2">
                        Tóm tắt<br />
                        <FCKeditorV2:FCKeditor ID="txtTomTat" runat="server" Height="300" Width="100%" ToolbarStartExpanded="true">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td valign="top" colspan="2">
                        Nội dung<br />
                        <FCKeditorV2:FCKeditor ID="txtChiTiet" runat="server" Height="300" Width="700" ToolbarStartExpanded="true">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnLuu" runat="server" Text="Lưu lại" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                        <asp:Button ID="btnHuy" runat="server" Text="Hủy" CssClass="cmdBtn" OnClick="btnHuy_Click"
                            CausesValidation="False" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
